<template>
    <div class="afterSell-group">
		<div style="position: relative;">
		
			<el-button
			  type="text"
			  v-if=" showadd == 'sign-up-info'"
			  class="admin-control-add"
			  @click="shop = true"
			></el-button>
		  </div>
		<tabs :tabs="tabLists" class="tab" :handleClick="handleClick"></tabs>
		
		 
		<router-view></router-view>
		<el-dialog title="新建团购" :visible.sync="shop" class="admin-control-edit">
			<el-form  label-position="left"  ref="ruleForm2">
			  <el-form-item label="用户名"  prop="member_name">
				<el-input  autocomplete="off"></el-input>
			  </el-form-item>
			  <el-form-item label="密码" >
				<el-input  autocomplete="off"></el-input>
				<el-checkbox  style="margin-left: 20px" >需要验证密码</el-checkbox>
			  </el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
			  <el-button @click="shop = false">取 消</el-button>
			  <el-button type="primary" @click="addShop">确 定</el-button>
			</div>
		  </el-dialog>
    </div>
</template>

<script>
	import Tabs from '@/components/tabs/tabs'

	export default {
		data() {
			return {
				tabLists:[
				
				{"label": "支付对账", "name": 'sign-up-info'},
				// {"label": "打款过账", "name": 'group-management'},
				
					// {"label": "发放导入", "name": 'group-detail'}
					
				],
				showadd: true,
				shop: false


			}
		},
		methods: {
			handleClick(tab, event) {
				const path = this.tabLists[tab.index].name;
				console.log('path',path)
				if (path == "group-management" || path == "sign-up-info"|| path == "group-category"|| path == "group-detail") {
        this.tabLists = [
		
		{"label": "支付对账", "name": 'sign-up-info'},
				//  {"label": "打款过账", "name": 'group-management'},
				
					// {"label": "发放导入", "name": 'group-detail'}
					
        ];
      } 
				this.showadd=path;
				this.$router.push({
					path: path
				});
			},   
		addShop() {
		console.log("新增成功");
		this.shop=false;
		
    }
    
		},
	 
  mounted() {
    //页面刷新就执行
    let path = this.$route.path.split("/").pop();
    this.showadd = path;
	
  },
  
        created() {
          console.log("------1");
        },
		components: {
			Tabs
		},
	
		name: "car-group"
	}
</script>

<style scoped>
.admin-control-add {
  margin-top: 15px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
</style>